package com.alienlab.finder.domain;


import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import javax.validation.constraints.*;

import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;

/**
 * A TemporaryPosition.
 */
@Entity
@Table(name = "temporary_position")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class TemporaryPosition implements Serializable {

    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @NotNull
    @Column(name = "open_id", nullable = false)
    private String openId;

    @Column(name = "position_x")
    private String positionX;

    @Column(name = "position_y")
    private String positionY;

    @Column(name = "jhi_time")
    private ZonedDateTime time;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOpenId() {
        return openId;
    }

    public TemporaryPosition openId(String openId) {
        this.openId = openId;
        return this;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getPositionX() {
        return positionX;
    }

    public TemporaryPosition positionX(String positionX) {
        this.positionX = positionX;
        return this;
    }

    public void setPositionX(String positionX) {
        this.positionX = positionX;
    }

    public String getPositionY() {
        return positionY;
    }

    public TemporaryPosition positionY(String positionY) {
        this.positionY = positionY;
        return this;
    }

    public void setPositionY(String positionY) {
        this.positionY = positionY;
    }

    public ZonedDateTime getTime() {
        return time;
    }

    public TemporaryPosition time(ZonedDateTime time) {
        this.time = time;
        return this;
    }

    public void setTime(ZonedDateTime time) {
        this.time = time;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TemporaryPosition temporaryPosition = (TemporaryPosition) o;
        if (temporaryPosition.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), temporaryPosition.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "TemporaryPosition{" +
            "id=" + getId() +
            ", openId='" + getOpenId() + "'" +
            ", positionX='" + getPositionX() + "'" +
            ", positionY='" + getPositionY() + "'" +
            ", time='" + getTime() + "'" +
            "}";
    }
}
